home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GENCSRC.ZIP / POINTER.C < prev    next >
Text File  |  1987-11-21  |  505b  |  13 lines

  1.                                          /* Chapter 8 - Program 1 */
  2. main()                             /* illustration of pointer use */
  3. {
  4. int index,*pt1,*pt2;
  5.  
  6.    index = 39;                             /* any numerical value */
  7.    pt1 = &index;                          /* the address of index */
  8.    pt2 = pt1;
  9.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  10.    *pt1 = 13;                  /* this changes the value of index */
  11.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  12. }
  13.